#ifndef _LINE_H_
#define _LINE_H_
#include <vector>

using namespace std;

class Condition;
class OpTreeNode;

// type of verilog code line
enum LineType
{
	LINE_ONCE, 
	LINE_ALWAYS,
	LINE_ASSIGN
};

enum LinePeriodicity
{
	LINE_EVERY_CYCLE,
	LINE_ONE_CYCLE,
	LINE_PERIODICALLY,
	LINE_AFTER_CYCLE
};

// Line contains all operands parsed from 1 verilog code line
class Line
{
public:
	Line(){}

	Line(vector<Line*> *childLines, LineType type, Condition* condition, LinePeriodicity periodicity, int timing, OpTreeNode* src);
	
	~Line(){}

	void PrintLine();

	bool Execute(int cycle);

	void ExecuteChilds(int cycle);

	int GetTiming() { return this->timing; }

	LineType GetType() { return this->type; }

private:
	LineType type;
	LinePeriodicity periodicity;

	Condition* condition;

	// parameter for lines depend on cycles
	int timing;

	// child lines
	vector<Line*> *childLines;

	// tree of operands
	OpTreeNode* src;
};
#endif
